package com.autoconfig;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.concurrent.TimeUnit;

/**
 * @author yuank
 * @version 1.0.0
 * @date 2025/2/11 10:24:23
 *
 * @description: yml全局配置
 *
 */

@ConfigurationProperties(prefix = "yk-fuse")
@Data
public class YKFuseProperties {

    // 熔断后重试次数
    @Value("${circuit.max-retry:3}")
    private int maxRetry;

    // 熔断后重试间隔
    @Value("${circuit.retry-interval:5000}")
    private long retryInterval;
    @Value("${circuit.retry-TimeUnit:TimeUnit.SECONDS}")
    private TimeUnit retryTimeUnit;

    // 重试失败告警bean
    @Value("${circuit.alert-class-name:YKFuseAlertServiceDefaultImpl}")
    private String alertClassName;

}